'''
Created on 30/03/2014

@author: juampi
'''
import unittest
import parsing
import chordinstrument
import tablature
from chordinstrument import Position

class Test(unittest.TestCase):


    def test_parser_get_position(self):
        source = """
E (5)|--10--------------------------------------------------------------------|
A (4)|------------------------------------------------------------------------|
E (4)|------------------------------------------------------------------------|
C (5)|------------------------------------------------------------------------|
G (4)|------------------------------------------------------------------------|
"""
        chords = parsing.Parser(source).resolve()        
        self.assertEqual(chords[0], tablature.Chords(2,Position(0,10)))        
        tab = tablature.Tab(chordinstrument.Charango(),72,chords).render()        
        self.assertEqual(source, tab)
        
        
if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()